/**
 * create by young (young2f@outlook.com) on 2020/12/3
 */
'use strict';
const model = require('../base/modelBase');
const _ = require('lodash');
module.exports = app => {
    const mongoose = app.mongoose;
    const schema = mongoose.Schema;
    const connect = app.mongooseDB.get('aiotBusiness');
    const json = {
        code: {type: String, desc: '编码'},
        startTime: {type: Date, desc: '会议开始时间'},
        endTime: {type: Date, desc: '会议结束时间'},
        meetingRoom: {type: String, desc: '会议室'},
        setTemp: {type: Number, desc: '设置目标温度'},
        setChillerTemp: {type: Number, desc: '设置制冷主机温度'},
        preCooling: {type: Number, desc: '提前降温'},
        status: {type: String, desc: '状态'},
        createdAt: {type: Date, default: Date.now()},
        updatedAt: {type: Date, default: Date.now()}
    };
    const _model = _.cloneDeep(model);
    _.assign(_model, json);
    const _schema = new schema(
        _model
    );
    return connect.model('MeetingRecord', _schema);
};
